from bipy.scenes import get, Scene
from psp2d import Controller

class BaseScene(Scene):
        
    def get_signal_matrix(self):
        """
        A hard-coded map of signal-type to listening handle method
        """
        sm = super(BaseScene, self).get_signal_matrix()
        sm.update({
            'render' : self.render
            })
        return sm
        
    def render(self):
        self.engine.buttons = Controller()
        self.engine.screen.clear()
        if self.engine.buttons.start:
            self.engine.pop_scene()
        elif self.engine.buttons.select:
            splsh_scene = get('splashscene')
            self.engine.push_scene( splsh_scene( self.engine ) )

scene_class = BaseScene